package com.example.yjj_java_web_homework3.repository;

import com.example.yjj_java_web_homework3.entity.Device;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * @author Li Chun Hei
 * @date 4/11/2025
 * @description
 */
@Repository
public interface DeviceRepository extends JpaRepository<Device, Long> {
    Optional<Device> findBySerialNumber(String serialNumber);
    List<Device> findByStatus(Device.DeviceStatus status);
    boolean existsBySerialNumber(String serialNumber);
}
